package day05;

import java.util.Arrays;

public class MaxOfArray {
    public static void main(String[] args) {
/*
        int[] w = new int[90];
        for (int i = 0; i < w.length; i++) {
            w[i] = (int) (Math.random() * 100);
            System.out.println(w[i]);

        }
        //找最大值
        int max=w[0];
        for(int i = 1;i<w.length;i++) {
            if(max<w[i]){
                max=w[i];
            }
        }
        System.out.println("数组最大的值"+max);
        int []ds={3,4,1,};
        int[]sd=new int[]{3,34,3};

        int max1=w[0];
        for(int i = 1;i<w.length;i++) {
            if(max1<w[i]){
                max1=w[i];
            }
        }
        System.out.println("数组最大的值"+max1);
        int []ds1={3,4,1,};
        int[]sd1=new int[]{3,34,3};
*/
        //数组的复制
        int[]a={2,34,12,34,34};
        int[]b= Arrays.copyOf(a,6);
        a=Arrays.copyOf(a,6);
        System.out.println(a);
        System.out.println(b);

        int[]t={3,2,1,2};
        t=Arrays.copyOf(t,7);
        int[]r=Arrays.copyOf(t,9);
        for(int i=0;i<t.length;i++){
            System.out.println(t[i]);
        }

        int[]y={23,34,546};
        y=Arrays.copyOf(y,9);
        for(int j=0;j<y.length;j++){
            System.out.println(y[j]);
        }
        System.out.println();

        int[]uki = Arrays.copyOf(y,6);
        for(int j=0;j<uki.length;j++){
             System.out.println(uki[j]);
        }
    }
}
